﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//using System.Web.UI.MobileControls;
using BLL.Store;


public partial class MenuHeader : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        string redit = "~/Search.aspx";
        bool isfirst = true;
        if (!string.IsNullOrEmpty(txtName.Text) || ddlDepartment.SelectedValue != "0")
        {
            redit += "?";
            if (!string.IsNullOrEmpty(txtName.Text))
            {
                redit += "Title=" + txtName.Text;
                isfirst = false;
            }

            if (ddlDepartment.SelectedValue != "0")
            {
                if (isfirst == false)
                    redit += "&";
                redit += "Dep=" + ddlDepartment.SelectedValue.ToString();
            }
        }
        this.Response.Redirect(redit);

    }
}
